package com.example.export.controller;

import com.example.export.service.DcAppService;
import com.example.export.vo.DcAppGotoByVo;
import com.example.export.vo.DcAppOrderPayDetail;
import com.example.export.vo.DcAppSearchCacheVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @author dangwen1
 * @date 2022年02月21日 21:27
 * @description
 */
@Controller
@Slf4j
//@CacheConfig(cacheNames = "caffeineCacheManager")
public class DcAppController {

    @Resource
    private DcAppService dcAppService;

    @GetMapping("/")
    public String gotoPage(){
        return "index";
    }

    @GetMapping("/setValue")
    public String setValue(@Valid DcAppGotoByVo dcAppGotoByVo){
        dcAppService.putValue(dcAppGotoByVo);
        return "success";
    }

    @ResponseBody
    @GetMapping("/getSearchList")
    public List<DcAppSearchCacheVo> getSearchList(){
        return dcAppService.getSearchList();
    }

    @ResponseBody
    @GetMapping("/getOrderList")
    public List<DcAppOrderPayDetail> getOrderList(){
        return dcAppService.getOrderList();
    }

}
